// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 登录接口  */
export async function login(body: BackApi.LoginQuery, options?: { [key: string]: any }) {
  return request<BackApi.ResCommon<any>>('/chatapi/back/admin/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 用户管理分页  */
export async function userGetPage(body: BackApi.UserQuery, options?: { [key: string]: any }) {
  return request<BackApi.ResCommon<BackApi.Page<BackApi.UserItem>>>('/chatapi/back/user/getPage', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 用户新增  */
export async function addUser(body: BackApi.UserAddParam, options?: { [key: string]: any }) {
  return request<BackApi.ResCommon<any>>('/chatapi/back/user/insert', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** log  */
export async function logPage(body: BackApi.LogQuery, options?: { [key: string]: any }) {
  return request<BackApi.ResCommon<BackApi.Page<BackApi.LogItem>>>(
    '/chatapi/rechargeHistory/getPage',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    },
  );
}

/** log  */
export async function addLog(body: BackApi.LogAddParam, options?: { [key: string]: any }) {
  return request<BackApi.ResCommon<any>>('/chatapi/rechargeHistory/insert', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** operation  */
export async function operatePage(body: BackApi.OperateQuery, options?: { [key: string]: any }) {
  return request<BackApi.ResCommon<BackApi.Page<BackApi.OperateItem>>>(
    '/chatapi/useHistory/getPage',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    },
  );
}
